{extend name="ace/layout/master/detail" /}

{block name="title"}菜单管理{/block}

{block name="page-title"}菜单{/block}

{block name="content"}
<input name="region_id" class="form-control" type="hidden" value="{if $detail}{$detail->region_id}{/if}" />
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 父级栏目： </label>
    <div class="col-sm-9">
        <?php $parent_id = input('parent_id', 0);?>
        <select name="parent_id" class="col-xs-10 col-sm-5">
            <option value="0">--默认顶级--</option>
            {if !empty($regions)}
                {foreach $regions as $region}
                    <option value="{$region['region_id']}"
                            {if $detail}
                                {$region['region_id'] == $detail->parent_id ? 'selected' : ''}
                            {else /}
                                {$region['region_id'] == $parent_id ? 'selected' : ''}
                            {/if}
                             > {$region['name']} </option>
                    {if !empty($region['_child'])}
                        {foreach $region['_child'] as $child}
                            <option value="{$child['region_id']}"
                                    {if $detail}
                                        {$child['region_id'] == $detail->parent_id ? 'selected' : ''}
                                    {else /}
                                        {$child['region_id'] == $parent_id ? 'selected' : ''}
                                    {/if}
                                    >├───{$child['name']} </option>
                        {/foreach}
                    {/if}
                {/foreach}
            {/if}
        </select>
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 名称： </label>
    <div class="col-sm-9">
        <input type="text" name="name" placeholder="输入名称" class="col-xs-10 col-sm-5" required="" value="{if $detail}{$detail->name}{/if}" />
        <span class="lbl col-xs-12 col-sm-7">
            <i class="icon-info-sign"></i> 唯一标识
        </span>
    </div>
</div>
<!--
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 简称： </label>
    <div class="col-sm-9">
        <input type="text" name="shortname" placeholder="输入简称" class="col-xs-10 col-sm-5" value="{if $detail}{$detail->shortname}{/if}" />
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 全称： </label>
    <div class="col-sm-9">
        <input type="text" name="merger_name" placeholder="输入全称" class="col-xs-10 col-sm-5" value="{if $detail}{$detail->merger_name}{/if}" />
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 拼音： </label>
    <div class="col-sm-9">
        <input type="text" name="pinyin" class="col-xs-10 col-sm-5" value="{if $detail}{$detail->pinyin}{/if}" />
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 长途区号： </label>
    <div class="col-sm-9">
        <input type="text" name="code" class="col-xs-10 col-sm-5" value="{if $detail}{$detail->code}{/if}" />
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 邮编： </label>
    <div class="col-sm-9">
        <input type="text" name="zip_code" class="col-xs-10 col-sm-5" value="{if $detail}{$detail->zip_code}{/if}" />
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 首字母： </label>
    <div class="col-sm-9">
        <input type="text" name="first" class="col-xs-10 col-sm-5" value="{if $detail}{$detail->first}{/if}" />
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 经度： </label>
    <div class="col-sm-9">
        <input type="text" name="lng" class="col-xs-10 col-sm-5" value="{if $detail}{$detail->lng}{/if}" />
    </div>
</div>
<div class="space-4"></div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 纬度： </label>
    <div class="col-sm-9">
        <input type="text" name="lat" class="col-xs-10 col-sm-5" value="{if $detail}{$detail->lat}{/if}" />
    </div>
</div>
-->
{/block}

{block name="script"}
<script type="text/javascript">
    window.onload = function () {
        closeLayerLoading(closeAllLayer);
    }
</script>
{/block}